﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;

namespace Halation
{
    /// <summary>
    /// Halation的上下文
    /// 此类负责整个Halation的环境建设,包括
    /// 1.配置文件,配置文件的固定文件夹(知道在哪里配置,实例化全部的配置类)
    /// 2.所有的系统使用的默认接口的默认示例(知道用什么接口,怎么实例化一个接口,管理整个系统的实例)
    /// 3.
    /// </summary>
    public static class HalationContext
    {
        private readonly static Type _HalationContextType = typeof(HalationContext);
        private readonly static string configurationFolderName = "Configurations/";
        private readonly static Lazy<string> location = new Lazy<string>(() => Path.GetDirectoryName(_HalationContextType.Assembly.CodeBase.Substring("file:///".Length)), true);
        private static Lazy<string> configurationFolder = new Lazy<string>(() => Path.Combine(Location.Value, configurationFolderName), true);
        private static object _getDefaule<T>() { return default(T); }
        public static Lazy<string> ConfigurationFolder { get { return HalationContext.configurationFolder; } }
        public static Lazy<string> Location { get { return HalationContext.location; } }




    }
}
